<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="button" value="添加用户" id="addBtn">
    <script>
        document.getElementById("addBtn").onclick = function(){
            let users = sessionStorage.getItem("users");
            if(!users){
                users = [];
            }else{
                users = JSON.parse(users);
            }
            users.push({phone:"13888888888",pwd:"123123"});
            sessionStorage.setItem("users",JSON.stringify(users));
        }
    </script>
</body>
</html>